package wu.dao;

import org.apache.ibatis.session.SqlSession;
import wu.mapper.CreateTableMapper;
import wu.util.MyBatisUtils;

import java.util.HashMap;
import java.util.Map;

public class CreateTableDao {
    public static void CreateTable(int num) {
        Map<String, String> params = new HashMap<>();
        params.put("tableName", ("user_table_" + num));
//        params.put("table_name", "wu666");
        SqlSession sqlSession= MyBatisUtils.getSession();
        CreateTableMapper mapper = sqlSession.getMapper(CreateTableMapper.class);
        mapper.createtable222(params);
        sqlSession.commit();
        sqlSession.close();
    }
}
